<?php defined('SYSPATH') OR die('No direct access allowed.');
$action = isset($comment) ? 'edit' : 'add';
// if this is not post controller, showing centered
$centered = (Router::$method == 'add' OR Router::$method == 'edit') ? " centered" : "";
?>
<!-- BEGIN COMMENT FROM -->
<form method="POST" class="editor_form<?=$centered?>" action="<?=url::base().Router::uri('forum', array('controller'=>'comment', 'method'=>'add'))?>">
	<h2><a name="comment"></a><?=Kohana::lang('comment.add.title')?></h2>
	<ol class="form editor">
		<input type="hidden" name="post_id" value="<?=$post->id?>" />
		<input type="hidden" name="category_id" value="<?=$post->category_id?>" />
		<? if (isset($comment)): ?><input type="hidden" name="id" value="<?=$comment->id?>" /><?endif;?>
		<li>
			<?message::render('validation', 'text')?>
			<label for="text"><?=Kohana::lang('comment.text.label')?></label>
			<?=$editor?>
		</li>
		<? if (!Captcha::instance()->promoted()): ?>
		<li class='captcha_container'>
			<? message::render('validation', 'captcha')?>
			<label for="captcha"><?=Kohana::lang('forum.captcha.label')?></label>
			<?	echo Captcha::instance()->render(TRUE);?>
			<?=form::input('captcha', message::custom('captcha'))?>
		</li>
		<? endif; ?>
		<li>
			<input type="submit" value="<?=Kohana::lang('comment.'.$action.'.submit')?>">
		</li>
	</ol>
</form>
<!-- END COMMENT FORM -->
